import pytest

import config
from api.order import OrderAPI
from common.utils import common_assert, read_json_file


class TestOrderAPI:
    def setup_class(self):
        self.order_api = OrderAPI()

    # 登录
    @pytest.mark.parametrize("username, pwd, status, code, msg", read_json_file(config.BASE_PATH + "/data/login.json"))
    def test_login(self, username, pwd, status, code, msg):
        response = self.order_api.login(username=username, password=pwd)
        print(response.json())
        common_assert(response, status, code, msg)

